// We need to include a couple Qt classes that we'll use:
#include <QMainWindow>
#include <QTcpSocket>

// This is the include file that Qt generates for us from the
// GUI we built in Designer
#include "ui_ChatterBox.h"

/*
 * This is the MainWindow class that we have told to inherit from
 * our Designer MainWindow (ui::MainWindow)
 */
class ChatterBox : public QWidget, public Ui::ChatterBox
{
	Q_OBJECT

	public:

		// Every QWidget needs a constructor, and they should allow
		// the user to pass a parent QWidget (or not).
		ChatterBox(QWidget *parent=0);

	private slots:

		// This gets called when you click the sayButton on
		// the chat page.
		void on_sayButton_clicked();

		// This is a function we'll connect to a socket's readyRead()
		// signal, which tells us there's text to be read from the chat
		// server.
		void readyRead();

		// This function gets called when the socket tells us it's connected.
		void connected();

	private:

		// This is the socket that will let us communitate with the server.
		QTcpSocket *socket;
};
